import request from '@/utils/request'

export function get(data) {
  return request({
    url: 'api/accountAc08/queryAccountAc08',
    method: 'post',
    data
  })
}
export function add(data) {
  return request({
    url: 'api/accountAc08',
    method: 'post',
    data
  })
}

export function del(ids) {
  return request({
    url: 'api/accountAc08/',
    method: 'delete',
    data: ids
  })
}

export function edit(data) {
  return request({
    url: 'api/accountAc08/',
    method: 'put',
    data
  })
}

export function computerAccount(data) {
  return request({
    url: 'api/accountAc50/computerAccount',
    method: 'post',
    data
  })
}


export function printAccount(data) {
  return request({
    url: 'api/accountAc50/printAccount',
    method: 'post',
    data
  })
}

export function downloadTemplate() {
  return request({
    url: '/api/accountAc08/downloadExcel',
    method: 'get',
    responseType: 'blob' // 必须指定
  })
}

export function importExcel(data) {
  return request({
    url: '/api/accountAc08/importExcel',
    method: 'post',
    data,
    transformRequest: [function(data) {
      return data; // 直接返回FormData对象，不进行转换
    }],
    headers: {
      'Content-Type': undefined // 让浏览器自动设置正确的Content-Type
    }
  })
}

export function getAc50all(data) {
  return request({
    url: 'api/accountAc50/getAc50All',
    method: 'post',
    data
  })
}


export default { get,add, edit, del,computerAccount,printAccount,downloadTemplate,importExcel,getAc50all}
